home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
351-375
/
disk_370
/
sksh
/
.skshinit
< prev
next >
Wrap
Text File
|
1992-05-06
|
3KB
|
130 lines
#*************************************************************************
#
# Set up variables, flags, and keymaps
#
#*************************************************************************
options +lEeFscC
PS1 = '$_ANSI_P3[$PWD]: $_ANSI_P1'
PS2 = '$_ANSI_P3> $_ANSI_P1'
PNPC = 21
LOGOUT = 'echo "\nBye!\n"'
LLMIN = 4
MAXDIST = 5
ROOT = ':'
_ANSI_BS = "^[[1m"
_ANSI_BE = "^[[m"
_ANSI_IS = "^[[3m"
_ANSI_IE = "^[[m"
_ANSI_US = "^[[4m"
_ANSI_UE = "^[[m"
_ANSI_P1 = "^[[0;31;40m"
_ANSI_P2 = "^[[0;32;40m"
_ANSI_P3 = "^[[0;33;40m"
_ANSI_CLEAR = "^[[H^[[2J"
_DIR_S = "$_ANSI_P3"
_DIR_E = "$_ANSI_P1"
#*************************************************************************
#
# Set up sksh aliases
#
#*************************************************************************
alias unalias = 'unset -a'
alias unfunc = 'unset -f'
alias aliases = 'set -a'
alias functions = 'set -f'
alias variables = 'set -v'
alias builtins = 'set -b'
alias help = 'set -bfa'
alias logout = 'exit 0'
alias pwd = 'echo "$PWD"'
alias clear = 'echo -n $_ANSI_CLEAR'
alias cls = 'echo -n $_ANSI_CLEAR'
alias ctpri = 'ChangeTaskPri'
alias '.' = 'source'
alias quit = 'LOGOUT=""; exit'
if [ "$SIZE" = 'normal' ] # large version only...
then
alias makedir = 'mkdir'
alias delete = 'rm'
alias remove = 'rm'
alias '!' = 'history -e'
alias '!!' = 'history -e -1'
alias ll = 'ls -lbF'
alias dir = 'ls -bF'
# setup emacs like keymap
setmap -r # reset the keymap
setmap -m 0 BOL '#' ACC # comment out line macro
setmap 0 8 BS 9 CC1 1 BOL 2 LFT 4 DEL 127 DEL 5 EOL 6 RHT \
7 ZAP 11 KEL 14 DN 15 EXE 16 UP 18 SRH 27 @1 155 @2 \
12 RDL 26 TIM 21 REP 20 SPC
setmap 1 27 CC1 = CC2 \* CC3 8 BDW f FWW b BKW d DLW \. ILP \
\/ ILT '<' HOL '>' TOL '#' '!0'
setmap 2 A UP B DN C RHT D LFT T HOL S TOL ' ' @3 \
48 FNK 49 FNK 50 FNK 51 FNK 52 FNK 53 FNK 54 FNK \
55 FNK 56 FNK 57 FNK
setmap 3 A BKW @ FWW
fi
#*************************************************************************
#
# Set up sksh functions
#
#*************************************************************************
function path { # set or examine path
local component;
if [ $# -eq 0 ]
then
echo "$PATH";
elif [ "$1" = "-add" -o "$1" = "add" ]
then
shift
for component in $* do
if [ $( expr index "$PATH," "$component," ) -eq 0 ]
then
PATH = "$PATH,$component"
fi
done
else
PATH = "$1"
fi
export -l PATH
}
function run { # run a program, searching the SKsh $PATH
local prog loc
prog = $1
shift
loc = $(which -s $prog)
if [ -z "$loc" ]
then
echo "$prog not found."
else
$(which -s run) $loc $*
fi
}